// 添加遮罩并设置html无法下滑

<div class="maskBack" style="
    background: #ccc;
    opacity: 0.5;
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1;
">123</div>
<script>
	document.querySelector('.maskBack').style.display = 'none'
	document.getElementsByTagName('html')[0].style.overflowY = 'hidden'
	if(1==2){
		document.querySelector('.maskBack').style.display = 'block'
		document.getElementsByTagName('html')[0].style.overflowY = 'scroll'		
	}
</script>
